package com.ruoyi.cngj.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cngj.mapper.CngjUserMapper;
import com.ruoyi.cngj.domain.CngjUser;
import com.ruoyi.cngj.service.ICngjUserService;
import com.ruoyi.common.core.text.Convert;

/**
 * 合作伙伴用户Service业务层处理
 * 
 * @author yuexl
 * @date 2024-06-27
 */
@Service
public class CngjUserServiceImpl implements ICngjUserService 
{
    @Autowired
    private CngjUserMapper cngjUserMapper;

    /**
     * 查询合作伙伴用户
     * 
     * @param id 合作伙伴用户ID
     * @return 合作伙伴用户
     */
    @Override
    public CngjUser selectCngjUserById(String id)
    {
        return cngjUserMapper.selectCngjUserById(id);
    }

    /**
     * 查询合作伙伴用户列表
     * 
     * @param cngjUser 合作伙伴用户
     * @return 合作伙伴用户
     */
    @Override
    public List<CngjUser> selectCngjUserList(CngjUser cngjUser)
    {
        return cngjUserMapper.selectCngjUserList(cngjUser);
    }

    /**
     * 新增合作伙伴用户
     * 
     * @param cngjUser 合作伙伴用户
     * @return 结果
     */
    @Override
    public int insertCngjUser(CngjUser cngjUser)
    {
        cngjUser.setCreateTime(DateUtils.getNowDate());
        return cngjUserMapper.insertCngjUser(cngjUser);
    }

    /**
     * 修改合作伙伴用户
     * 
     * @param cngjUser 合作伙伴用户
     * @return 结果
     */
    @Override
    public int updateCngjUser(CngjUser cngjUser)
    {
        cngjUser.setUpdateTime(DateUtils.getNowDate());
        return cngjUserMapper.updateCngjUser(cngjUser);
    }

    /**
     * 删除合作伙伴用户对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteCngjUserByIds(String ids)
    {
        return cngjUserMapper.deleteCngjUserByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除合作伙伴用户信息
     * 
     * @param id 合作伙伴用户ID
     * @return 结果
     */
    @Override
    public int deleteCngjUserById(String id)
    {
        return cngjUserMapper.deleteCngjUserById(id);
    }
}
